import { getMock } from './mock'
import { getMockRoomPosition } from './Roomposition'
let roomposi =  getMockRoomPosition();
// 伪造 creep 的默认值
class CreepMock {
    body: BodyPartDefinition[] = [{ type: MOVE, hits: 100 }]
    fatigue: number = 0
    hits: number = 100
    hitsMax: number = 100
    id: Id<this> = `${new Date().getTime()}${Math.random()}` as Id<this>
    // memory: CreepMemory = { }
    my: boolean = true
    name: string = `creep${this.id}`
    owner: Owner = { username: 'hopgoldy' }
    // room: Room={}
    spawning: boolean = false
    saying: string=""
    pos:RoomPosition= roomposi
    // store: StoreDefinition
    ticksToLive: number | undefined = 1500
    _heal:number=100
    getAbilltyHeal()
    {
        
        return this._heal
    }
    heal(creep:CreepMock)
    {
        console.log(`${this.name}->heal${creep.name}`);
    }
}

/**
 * 伪造一个 creep
 * @param props 该 creep 的属性
 */
export const getMockCreep = getMock<Creep>(CreepMock)
